<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<#assign path="${request.getContextPath()}">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<script src="${path}/jquery/jquery.min.js" type="text/javascript"></script>
<link href="${path}/userCenter/css/validationEngine.jquery.css" type="text/css" rel="stylesheet"/>
<script src="${path}/jquery/jquery.validationEngine-cn.js" type="text/javascript"></script>
<script src="${path}/jquery/jquery.validationEngine.js" type="text/javascript"></script>
<script src="${path}/jquery/comment-replay.js" type="text/javascript"></script>
<script src="${path}/article/js/aritcleDetail.js" type="text/javascript"></script>
<link href="${path}/css/highlight.css" type="text/css" rel="stylesheet"/>
<script src="${path}/js/highlight.pack.js" type="text/javascript"></script>
<link href="${path}/css/blog.css" type="text/css" rel="stylesheet"/>
<!--[if IE]> <link href="${path}/css/prettiyprint_ie_fix.css" type="text/css" rel="stylesheet" /><![endif]-->
<title>${blogArticle.article.title}-<#list blogArticle.article.keyWordSet as keyWord>${keyWord.name}-</#list> <@s.text name='blog.title'/> </title>
<link rel="short cut icon" HREF="${path}/images/favicon.ico" />
<script>
  hljs.tabReplace = '    ';
  hljs.initHighlightingOnLoad();
</script>

</head>

<body>
<div id="wrapper">
	<#include "/header.ftl" />
	<div id="content">
		<div class="post">
			<h2 class="post-title"><a href="#" title="${blogArticle.article.title}"> ${blogArticle.article.title} </a></h2>
			<#assign articleDate = "${blogArticle.article.writeDate}" />
			<#assign articleDateFormart = "${articleDate?date('yy-mm-dd')}" />
			<p class="post-date">
				<span class="day">${articleDateFormart?split('-')[2]}</span> 
				<span class="month">${articleDateFormart?split('-')[1]}</span>
			    <span class="year">${articleDateFormart?split('-')[0]}</span> 
				<#if blogArticle.commentsCount gt 0><span class="postcomment">${blogArticle.commentsCount} comments</span><#else><span class="postcomment">No comment</span></#if>
			<p class="post-data"><span class="postauthor">by ${blogArticle.article.author.userName}</span><span class="postcategory">in ${blogArticle.article.articleCategories.categoryName}</span> Tags: <#list blogArticle.article.keyWordSet as keyWord>${keyWord.name}</#list> </p>
			
			${blogArticle.article.content}
			<p class="post-nav">
				<#if preArticle??><span class="previous"> <a href="<@s.url action="articleDetail" namespace="/article" ><@s.param name="bid" value="${preArticle.id}" /><@s.param name="pageNo" value="1" /></@s.url>" rel="prev"><em>Previous</em>${preArticle.article.title}</a></span> </#if>
				<#if nextArticle??><span class="next"> <a href="<@s.url action="articleDetail" namespace="/article" ><@s.param name="bid" value="${nextArticle.id}" /><@s.param name="pageNo" value="1" /></@s.url>" rel="next"><em>Next</em>${nextArticle.article.title}</a></span> </#if>
			</p>
			
			<h4 id="comments">${blogArticle.commentsCount}<@s.text name="article.comment" />  <em>(<a href="#respond">+<@s.text name="article.comment.add" />?</a>)</em></h4> 
			<div class="comment-nav"> 
				<span class="previous"></span> 
				<span class="next"></span> 
			</div>
			<#if blogArticle.commentOpen?string == 'true' >
				<ol class="commentlist">
			  		<#list commentList as comment> 
			  			<#if !comment.rootComment??>
							<li> 
								<p class="comment-author">
									<#if  comment.author.male?string =='true'> 
									<img alt='' src='${path}/images/male.jpg' class='avatar avatar-48 photo <#if comment_index == 0>firstavatar</#if>' height='48' width='48' />			
									<#else>
									<img alt='' src='${path}/images/female.jpg' class='avatar avatar-48 photo' height='48' width='48' />			
									</#if>
									<cite>
										<a href='${comment.author.web?default("#Z")}' rel='external nofollow' class='url' ><small>${comment.author.userName}</small></a> 
										<#if UserName?? && comment.author.userName == UserName ><span><a rel='nofollow' href='#respond' onclick='return articleDetail.editComment("commententry-${comment.id}", "${comment.id}", "respond", "${blogArticle.id}")'><small><strong>[<@s.text name='edit'/>]</strong></span></small></a></span></#if>
										<#if comment.lastEditDate??><small><@s.text name='last.edit' /><small>${comment.lastEditDate}</small></small> </#if>
									</cite>
									<br/>
									<#assign commentDate = "${comment.commentDate}" />
									<small>${commentDate?date('yy-mm-dd')} @ ${commentDate?split(' ')[1]}</small> 
								</p> 
								<div class="commententry" id="commententry-${comment.id}"> 
									<i><b><#if comment.display == true>${comment.content}<#else> ------------</#if> </b> </i> 
								</div> 
								<p class="reply"> 
									<a rel='nofollow' class='comment-reply-link' href='#respond' onclick='return articleDetail.postComment("commententry-${comment.id}", "${comment.id}", "respond", "${blogArticle.id}")'>Reply</a>
								</p> 
							</li>
					   <#else>
						  <ul class="chidren">
							  <li> 
								 <p class="comment-author"> 
									<#if  comment.author.male?string =='true'> 
									<img alt='' src='${path}/images/male.jpg' class='avatar avatar-48 photo' height='48' width='48' />			
									<#else>
									<img alt='' src='${path}/images/female.jpg' class='avatar avatar-48 photo' height='48' width='48' />			
									</#if>
									<cite>
										<a href='${comment.author.web?default("#Z")}' rel='external nofollow' class='url'><small>${comment.author.userName}</small></a>
										<#if UserName?? && comment.author.userName == UserName ><span><a rel='nofollow' href='#respond' onclick='return articleDetail.editComment("commententry-${comment.id}", "${comment.id}", "respond", "${blogArticle.id}")'><small><strong>[<@s.text name='edit'/>]</strong></span></small></a></span></#if>
										<#if comment.lastEditDate??><small><@s.text name='last.edit' /><small>${comment.lastEditDate}</small></small> </#if>	
									</cite>
									<br/>
									<#assign commentDate = "${comment.commentDate}" />
									<small> ${commentDate?date('yy-mm-dd')} @ ${commentDate?split(' ')[1]}</small> 
								</p> 
								<div class="commententry" id="commententry-${comment.id}"> 
									<p><i><b><#if comment.display == true>${comment.content}<#else> ------------</#if> </b> </i></p> 
								</div> 
								<p class="reply"> 
									<a rel='nofollow' class='comment-reply-link' href='#respond' onclick='return articleDetail.postComment("commententry-${comment.id}", "${comment.id}", "respond", "${blogArticle.id}")'>Reply</a>
								</p> 
							  </li>
						   </ul>
						</#if>
					</#list>
				</ol>
			
				<div id="respond"> 
				
					<h4>Leave a Reply</h4>
					<p class="cancel-comment-reply"> 
						<a rel="nofollow" id="cancel-comment-reply-link" href="#respond" style="display:none;" >Cancel</a>
					</p> 
					<form  method="post" id="commentform"> 
					<#if !UserName??>
					<p>
						<input class="validate[required]" type="text" name="userName" id="userName" value="" size="22" tabindex="1" aria-required='true' maxLength="200"  /> 
						<label for="author"><@s.text name="username"/> <small>(<@s.text name="invalidate.required"/>)</small></label>
						<label for="author">  <a href="<@s.url action='register' namespace='/userCenter'/>" target="_blank"><@s.text name="user.register"/> <small></small></a></label>
					</p> 
					<p>
						<input class="validate[required]" type="password" name="password" id="password" value="" size="27" tabindex="2" aria-required='true' maxLength="200" /> 
						<label for="email"><@s.text name="password"/> <small>(<@s.text name="invalidate.required"/>)</small></label>
						<label for="email"> <a href="<@s.url action='forgetPassword' namespace='/userCenter'/>" target="blank"><@s.text name="user.forgetPassword"/>?</a></label>
					</p>
					<p>
						<input type='hidden' name='quickLogin' value='true' id='quickLogin' /> 
					</p>
					<#else>
					<p>
						<input type='hidden' name='quickLogin' value='false' id='quickLogin' /> 
					</p>
					</#if>
					
					<!--<p><small><strong>XHTML:</strong> You can use these tags: <code>&lt;a href=&quot;&quot; title=&quot;&quot;&gt; &lt;abbr title=&quot;&quot;&gt; &lt;acronym title=&quot;&quot;&gt; &lt;b&gt; &lt;blockquote cite=&quot;&quot;&gt; &lt;cite&gt; &lt;code&gt; &lt;del datetime=&quot;&quot;&gt; &lt;em&gt; &lt;i&gt; &lt;q cite=&quot;&quot;&gt; &lt;strike&gt; &lt;strong&gt; </code></small></p>--> 
					<p>
						<textarea class="validate[required,length[1,5000]]" name="comment" id="comment" cols="58" rows="10" tabindex="4" maxLength="50000"></textarea>
					</p> 
					<p>
						<input name="submit" type="button" id="submit" tabindex="5" value="Submit Comment" /> 
						<input type='hidden' name='comment_post_ID' value='${blogArticle.id}' id='comment_post_ID' /> 
						<input type='hidden' name='comment_parent' id='comment_parent' value='0' /> 
						<input type='hidden' name='editCommentId' value='' id='editCommentId'/>
					</p> 
					</form> 
				</div>
			</#if>   
		</div>
		<#if blogArticle.commentOpen>
			<#assign action = "articleDetail" />
			<#assign namespace = "/article" />
			<#assign param = {"bid":"${blogArticle.id}"}/>
			<#include "/pager.ftl" />
		</#if>
		<!--/post -->
	<!--	<p class="post-nav"><span class="previous">Pre</span> <span class="next">Next</span></p>  -->
	</div>
	<#include "/sideBar.html" />
	<#include "/footer.ftl" />
</div>	
</body>

</html>